<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>

const promise1 = new Promise((resolve,reject)=>{
        reject("failure")
  }).catch(err=>{
    console.log(err)
  })
 
    //这种写法也是可以的
  const promise2 = new Promise((resolve,reject)=>{
         resolve("suffess")
  })
   //1.then参数的传递方法，可以传递两个参数
promise2.then(res=>{
console.log('成功的回调~',res)
},err=>{
  console.log("失败的回调~",err)

})
promise1.then(res=>{
  console.log("成功的回调",res)
})
promise1.then(res=>{
  console.log("成功的回调",res)
})
promise1.then(res=>{
  console.log("成功的回调",res)
})
promise1.then(res=>{
  console.log("成功的回调",res)
})
  </script>

</body>
</html>